package com.ysh.web.controller;

import com.ysh.service.store.*;
import com.ysh.service.store.impl.*;
import com.ysh.service.system.DeptService;
import com.ysh.service.system.RoleService;
import com.ysh.service.system.UserService;
import com.ysh.service.system.impl.DeptServiceImpl;
import com.ysh.service.system.impl.RoleServiceImpl;
import com.ysh.service.system.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
/*
    抽取业务层对象
 */
public class BaseServlet extends HttpServlet {
    protected CompanyService companyService;            // 企业管理业务层对象
    protected DeptService deptService;                  // 部门管理业务层对象
    protected UserService userService;                  // 用户管理业务层对象
    protected CourseService courseService;              // 学科管理业务层对象
    protected CatalogService catalogService;            // 学科目录业务层对象
    protected QuestionService questionService;          // 试题管理业务层对象
    protected QuestionItemService questionItemService;  // 题目选项管理业务层对象
    protected RoleService roleService;                  // 角色管理业务层对象

    @Override
    public void init() throws ServletException {
        companyService = new CompanyServiceImpl();
        deptService = new DeptServiceImpl();
        userService = new UserServiceImpl();
        courseService = new CourseServiceImpl();
        catalogService = new CatalogServiceImpl();
        questionService = new QuestionServiceImpl();
        questionItemService = new QuestionItemServiceImpl();
        roleService = new RoleServiceImpl();
    }
}
